<template>
  <div>
    <ZgEdit
      ref="dialog"
      :columns="columns"
      :formulas="formulas"
      :view="view"
      validUrl=""
      :param="{ id: stepId }"
      @ok="onOk"
      saveUrl="/zg-autoflow/autoFlow/step/update">
    </ZgEdit>
  </div>
</template>
<script>

export default {

  data () {
    return {
      view: { width: '60%', top: '5%', title: '修改环节' },
      columns: [
        { name: '环节名称', code: 'stepName', compType: '单行文本', isNeed: false, offset: 0, span: 24, defaultVal: '' },
        { name: '是否配置', code: 'formType', compType: '字典', isNeed: false, offset: 0, span: 24, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '下一环节', code: 'nextStepId', compType: '单行文本', isNeed: false, offset: 0, span: 24, defaultVal: '' },
        { name: '可重新编辑', code: 'isEdit', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '是否盖章', code: 'isSeal', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '可以退回', code: 'isReturn', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '可以被退回', code: 'isReturned', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },

        { name: '单签会签', code: 'approveType', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowApproveType' } },
        { name: '是否结束节点', code: 'isStepEnd', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '环节发票类型', code: 'billStep', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowBillStep' } },
        { name: '模式', code: 'selectHandlerMode', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowHandlerMode' } },
        { name: '是否需要发送短信', code: 'shortMessage', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '短信模板类型', code: 'shortMessageType', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } },
        { name: '退回是否需要审批', code: 'isBackApproval', compType: '字典', isNeed: false, offset: 0, span: 12, defaultVal: '', extra: { 字典类型: 'flowIsConfig' } }

      ],
      formulas: [
        { triggerMode: '初始化时', name: '公式1', content: 'console.log("init");' },
        { triggerMode: '数据变化时', name: '公式2', content: 'console.log("update");' },
        { triggerMode: '提交时', name: '公式3', content: 'console.log("submit");' }
      ],
      stepId: ''
    }
  },
  methods: {
    open (obj) {
      this.stepId = obj.id
      this.$refs.dialog.open(obj)
    },
    onOk () {
      this.$emit('ok')
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
